package com.hzw.controller;

import com.hzw.model.Channel;
import com.hzw.model.City;
import com.hzw.model.Users;
import com.hzw.service.ChannelService;
import com.hzw.service.CityService;
import com.hzw.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 测试控制器
 */
@Controller
public class TestController {

    @Autowired
    private CityService cityService;
    @Autowired
    private UsersService usersService;
    @Autowired
    private ChannelService channelService;

    @RequestMapping("user")
    @ResponseBody
    public List<Users> findUsers(){
        return usersService.findUser();
    }

    @RequestMapping("city")
    @ResponseBody
    public List<City> findCity(){
        return cityService.findCity();
    }

    @RequestMapping("channel")
    @ResponseBody
    public List<Channel> findChannel(){
        return channelService.findChannel();
    }
}
